package com.team.engine.fileupload.action;

import java.util.List;

import javax.annotation.Resource;

import com.team.engine.common.view.BaseActionAbs;
import com.team.engine.fileupload.dao.TFilegroup;
import com.team.engine.fileupload.service.FileuploadServiceImpl;
import com.team.engine.util.SubPage;

/**
 * 文件上传流程控制类
 * @author MengLH
 * @data 2010-8-25
 */
public class FileManageAction extends BaseActionAbs {

	private static final long serialVersionUID = -2863715117965622151L;
	
	@Resource(name="fileuploadServiceImpl")
	private FileuploadServiceImpl fileuploadService;
	
	public void setFileuploadServiceImpl(FileuploadServiceImpl fileuploadServiceImpl) {
		this.fileuploadService = fileuploadServiceImpl;
	}

	@Override
	public String execute() throws Exception {
		String page = this.request.getParameter("page");
		SubPage<TFilegroup> b = this.fileuploadService.getFilegroupAll(page);
		List<TFilegroup> list = b.getResultList();
		this.request.setAttribute("result", b);
		if(list!=null) {
			this.request.setAttribute("totalPage", b.getTotalPage());
		}
		return SUCCESS;
	}

}
